package com.hbx.residential_service.domain;

import com.hbx.residential_service.utils.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class Repair {
    private int rpId;
    private String rpTitle;
    private String rpContent;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date rpDate;
    private String rpDateStr;
    private Integer rpStatus;
    private String rpStatusStr;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date rpHandleDate;
    private String rpHandleDateStr;
    private User user;
    private Admin admin;

    public int getRpId() {
        return rpId;
    }

    public void setRpId(int rpId) {
        this.rpId = rpId;
    }

    public String getRpTitle() {
        return rpTitle;
    }

    public void setRpTitle(String rpTitle) {
        this.rpTitle = rpTitle;
    }

    public String getRpContent() {
        return rpContent;
    }

    public void setRpContent(String rpContent) {
        this.rpContent = rpContent;
    }

    public Date getRpDate() {
        return rpDate;
    }

    public void setRpDate(Date rpDate) {
        this.rpDate = rpDate;
    }

    public String getRpDateStr() {
        if(rpDate!=null){
            rpDateStr= DateUtils.DateToString(rpDate,"yyyy-MM-dd");
        }
        return rpDateStr;
    }

    public void setRpDateStr(String rpDateStr) {
        this.rpDateStr = rpDateStr;
    }

    public Integer getRpStatus() {
        return rpStatus;
    }

    public void setRpStatus(Integer rpStatus) {
        this.rpStatus = rpStatus;
    }

    public String getRpStatusStr() {
        if(rpStatus!=null){
            if(rpStatus==0)rpStatusStr="未处理";
            if(rpStatus==1)rpStatusStr="已处理";
        }
        return rpStatusStr;
    }

    public void setRpStatusStr(String rpStatusStr) {
        this.rpStatusStr = rpStatusStr;
    }

    public Date getRpHandleDate() {
        return rpHandleDate;
    }

    public void setRpHandleDate(Date rpHandleDate) {
        this.rpHandleDate = rpHandleDate;
    }

    public String getRpHandleDateStr() {
        if(rpHandleDate!=null){
            rpHandleDateStr= DateUtils.DateToString(rpHandleDate,"yyyy-MM-dd");
        }
        return rpHandleDateStr;
    }

    public void setRpHandleDateStr(String rpHandleDateStr) {
        this.rpHandleDateStr = rpHandleDateStr;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Admin getAdmin() {
        return admin;
    }

    public void setAdmin(Admin admin) {
        this.admin = admin;
    }
}
